package ShoppingMall;

public class Shopping {
    public static void main(String[] args){
        Product p1 = new Product();
        Product p2 = new Product();
        Product p3 = new Product();
        Product p4 = new Product();
        Product p5 = new Product();
        p1.setProName("washing machine");
        p2.setProName("air conditioner");
        p3.setProName("computer");
        p4.setProName("keyboard");
        p5.setProName("shoes");
        Market m = new Market();
        m.setMarketName("Walmart");
        m.setProductArr(new Product[] {p1,p2,p3,p4,p5});
        Person p = new Person();
        p.setPersonName("John");
        Product result = p.shopping(m,"computer"); //? 
        if (result!= null){
            System.out.println(p.getPersonName() + " buy " + result.getProName() + " in " + m.getMarketName()  +"!"); 
        }
        else{
            System.out.println(p.getPersonName() + "can't buy this thing " + " in " +m.getMarketName() + "!");
            //if that is null,you can't use this to do shit;
            //didn't add ();
        } 
    }
}
